{"id":1562,"date":"2014-08-27T19:22:01","date_gmt":"2014-08-27T18:22:01","guid":{"rendered":"http:\/\/denbeke.be\/blog\/?p=1562"},"modified":"2014-08-27T19:22:01","modified_gmt":"2014-08-27T18:22:01","slug":"handige-cmake-configuratie","status":"publish","type":"post","link":"https:\/\/denbeke.be\/blog\/programmeren\/handige-cmake-configuratie\/","title":{"rendered":"Handige CMake configuratie"},"content":{"rendered":"<p>Handige <a title=\"CMake\" href=\"http:\/\/www.cmake.org\" target=\"_blank\">CMake<\/a> configuratie waarmee je alle source files in een project automatisch compileert en installeert.<\/p>\n<p>Simpeler kan haast niet&#8230;<\/p>\n<p>&nbsp;<\/p>\n<pre><code>cmake_minimum_required(VERSION 2.8)\r\nset(CMAKE_CXX_FLAGS \"--std=c++11\")\r\n\r\nINCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}\/src)\r\n\r\nfile(GLOB SRC\r\n    \"src\/*.cpp\"\r\n)\r\n\r\nadd_executable(ProjectName ${SRC})\r\ninstall(TARGETS ProjectName DESTINATION ${PROJECT_SOURCE_DIR}\/bin)\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>Deze\u00a0<code>CMakeLists.txt<\/code> plaats je in de root directory. Code komt in de <code>src<\/code> map, executable komt in de <code>bin<\/code> map, en het project compilen (en CMake files genereren) doe je in de <code>build<\/code> map.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Handige CMake configuratie waarmee je alle source files in een project automatisch compileert en installeert. Simpeler kan haast niet&#8230; &nbsp; cmake_minimum_required(VERSION 2.8) set(CMAKE_CXX_FLAGS &#8220;&#8211;std=c++11&#8221;) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}\/src) file(GLOB SRC &#8220;src\/*.cpp&#8221; ) add_executable(ProjectName ${SRC}) install(TARGETS ProjectName DESTINATION ${PROJECT_SOURCE_DIR}\/bin) &nbsp; Deze\u00a0CMakeLists.txt plaats je in de root directory. Code komt in de src map, executable komt in de bin map, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[122],"tags":[204,203],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.6.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Handige CMake configuratie &ndash; DenBeke<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/denbeke.be\/blog\/programmeren\/handige-cmake-configuratie\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Handige CMake configuratie &ndash; DenBeke\" \/>\n<meta property=\"og:description\" content=\"Handige CMake configuratie waarmee je alle source files in een project automatisch compileert en installeert. Simpeler kan haast niet&#8230; &nbsp; cmake_minimum_required(VERSION 2.8) set(CMAKE_CXX_FLAGS &quot;--std=c++11&quot;) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}\/src) file(GLOB SRC &quot;src\/*.cpp&quot; ) add_executable(ProjectName ${SRC}) install(TARGETS ProjectName DESTINATION ${PROJECT_SOURCE_DIR}\/bin) &nbsp; Deze\u00a0CMakeLists.txt plaats je in de root directory. Code komt in de src map, executable komt in de bin map, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/denbeke.be\/blog\/programmeren\/handige-cmake-configuratie\/\" \/>\n<meta property=\"og:site_name\" content=\"DenBeke\" \/>\n<meta property=\"article:published_time\" content=\"2014-08-27T18:22:01+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:site\" content=\"@MthsBk\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/denbeke.be\/blog\/#website\",\"url\":\"https:\/\/denbeke.be\/blog\/\",\"name\":\"DenBeke\",\"description\":\"Mathias Beke\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/denbeke.be\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/denbeke.be\/blog\/programmeren\/handige-cmake-configuratie\/#webpage\",\"url\":\"https:\/\/denbeke.be\/blog\/programmeren\/handige-cmake-configuratie\/\",\"name\":\"Handige CMake configuratie &ndash; DenBeke\",\"isPartOf\":{\"@id\":\"https:\/\/denbeke.be\/blog\/#website\"},\"datePublished\":\"2014-08-27T18:22:01+00:00\",\"dateModified\":\"2014-08-27T18:22:01+00:00\",\"author\":{\"@id\":\"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/denbeke.be\/blog\/programmeren\/handige-cmake-configuratie\/\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc\",\"name\":\"Mathias Beke\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/denbeke.be\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/015ba35e6ce4f5859e3888ca99807575?s=96&d=mm&r=g\",\"caption\":\"Mathias Beke\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1562"}],"collection":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/comments?post=1562"}],"version-history":[{"count":2,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1562\/revisions"}],"predecessor-version":[{"id":1564,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1562\/revisions\/1564"}],"wp:attachment":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/media?parent=1562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/categories?post=1562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/tags?post=1562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}